package com.sg.action;

import com.sg.service.TestService;
import com.sun.tools.javac.code.Printer;
import io.netty.handler.codec.http.HttpResponse;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.springframework.beans.factory.annotation.Autowired;

import javax.servlet.http.HttpServletResponse;
import javax.sound.midi.Soundbank;
import java.io.IOException;
import java.io.Writer;

/**
 * Created by shugen on 2017/7/25.
 */
@ParentPackage("struts-default")
@Namespace("/test")
@Action(value="TestAction")
public class TestAction {
    private String name;
    @Autowired
    TestService testService;
    public void test() throws IOException {
        System.out.println("进来了==");
        System.out.println(name);
        HttpServletResponse response = ServletActionContext.getResponse();
        response.setContentType("text/plain;charset=UTF-8");
        response.getWriter().write("test123456");
      //  testService.getUser();
//testService.del();
    }


    public void  getForm(){
        System.out.println(name);
        System.out.println(1122);
        int i=0;
      for (i=0;i<5;i++){
        int b=i+1;

      }


    }


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
